package org.simple.learning.sb.log4j.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 项目名称：java-web-leaning
 * 类名称：LogController
 * 类描述：LogController
 * 创建时间：2018/5/31
 *
 * @author guihuo   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
@RestController
public class LogController {

    private final Logger log = LoggerFactory.getLogger(this.getClass());
    private final Logger domainExceptionLog = LoggerFactory.getLogger("domainException");

    /**
     * 返回项目元数据
     *
     * @return .
     */
    @RequestMapping("/index")
    public String log(@RequestBody String body) {
        log.info(body);
        return "success";
    }

    @RequestMapping("/index2")
    public String log2(@RequestBody String body) {
        domainExceptionLog.info(body);
        return "success";
    }


}